package com.itheima.demo;

import java.util.Scanner;

public class Java_04 {
    public static void main(String[] args) {
        //动态数组的初始化
//        int[] ages = new int[100];
//        ages[0] = 100;
//        System.out.println(ages[0]);
        //动态数组的初始化案例
        //遍历数组中的每个位置，录入评委的分数，存入到数组当中去
        double[] scores = new double[6];
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < scores.length; i++) {
            System.out.println("请您输入当前第"+(i + 1)+"歌评委的分数：");
            double score = sc.nextInt();
            scores[i] = score;
        }
        double sum = 0;
        for (int i = 0; i < scores.length; i++) {
            sum += scores[i];
        }
        System.out.println("选手的最终得分是：" + sum / scores.length);

    }
}
